package com.example.threadpool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;

public class MainTest2 {

    public static void main(String[] args) {
        TimingThreadPool executor = new TimingThreadPool(
                2,
                3,
                0, TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<>(10));
        executor.execute(new task2());
        executor.submit(new task2());
        executor.shutdown();
    }

}

class task2 implements Runnable {

    @Override
    public void run() {
        System.out.println("进入了TimingThreadPool task方法！！！");
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

    }
}
